package org.daochong.lang.database;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import org.daochong.lang.JdbcTemplate;
import org.daochong.lang.Page;
import org.daochong.lang.PageResult;

public interface Database {

	public String getName();

	public PageResult<Map<String, Object>> listObjects(JdbcTemplate jdbc, Page page, String sql, Object... params)
			throws SQLException;

	public List<String> getTableList(JdbcTemplate jdbc) throws SQLException;

	public Map<String, Column> getColumns(String tableName, JdbcTemplate jdbc) throws SQLException;

	public String getColumnType(Object val);

	public String getColumnType(Object val, int length);

	public String getColumnType(Object val, int length, int precision);

	public String getColumnType(Class<?> clazz);

	public String getColumnType(Class<?> clazz, int length);

	public String getColumnType(Class<?> clazz, int length, int precision);
}
